 <?php require_once('Connections/connect.php'); ?>

 <?
$loi='';
if(isset($_REQUEST["txttv"]))
{
  $tenthanhvien = $_REQUEST["txttv"];
   $mathanhvien= $_REQUEST["txtmk"];
   $mahoalog = md5($mathanhvien);
   $sql="select * from thanhvien where tenthanhvien='".$tenthanhvien."' and matkhau='".$matkhau."'";
   $result=mysql_query($sql,$connect);
   $num_row=mysql_num_rows($result);
   if($num_row!=0)
   {
     while($row = mysql_fetch_array($result))
	 {
	    if($mahoalog == $row["mathanhvien"])
		{
		   session_register("hoten");
		   $_SESSION["hoten"]= $row["hoten"];
		   $_SESSION["tenthanhvien"] = $row["tenthanhvien"];
		   $_SESSION["matkhau"] =$row["matkhau"];
		   $_SESSION["mathanhvien"] =$row["mathanhvien"];
		   redirect("index.php");
		}
		else
		{
		echo("l?i");
				}
	 }
   }
   else
		{
		echo("l?i");
				}
  }
?>